package com.shsxt.controller;

import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shsxt.service.AuntService;

import cn.jiguang.common.resp.APIConnectionException;
import cn.jiguang.common.resp.APIRequestException;


@Controller
@RequestMapping("aunt")
public class AuntController  {
	
	
	@Autowired
	private AuntService auntService;
	//我的
    @RequestMapping(value="login")
	public  @ResponseBody Map<String, Object> login( String servicePersonal,String pwd) {
    	Map<String, Object> all = auntService.login(servicePersonal,pwd);
		return all;
	}
	//我的
    @RequestMapping(value="wode")
	public  @ResponseBody Map<String, Object> wode( String servicePersonal) {
    	Map<String, Object> all = auntService.wode(servicePersonal);
    	System.out.println("11");
		return all;
	}
	
	//订单所有(该用户所有订单，共3块)
    @RequestMapping(value="all")
	public  @ResponseBody Map<String, Object> all(String servicePersonal) throws ParseException {
    	Map<String, Object> all = auntService.all(servicePersonal);
		return all;
	}
  //抢单
    @RequestMapping(value="grab")
	public  @ResponseBody Map<String, Object> grab(String servicePersonal ) throws ParseException {
    	Map<String, Object> all = auntService.grab(servicePersonal);
		return all;
	}
    //抢单
    @RequestMapping(value="affirmGrab")
	public  @ResponseBody Map<String, Object> affirmGrab(String orderNumber,String type,String servicePersonal) throws ParseException {
    	Map<String, Object> map = auntService.affirmGrab(orderNumber,type,servicePersonal);
		return map;
	}
  //点击服务完成   更新订单状态
    @RequestMapping(value="state")
	public  @ResponseBody Map<String, Object> state( String orderNumber,String type) throws ParseException, APIConnectionException, APIRequestException {
    	Map<String, Object> map = auntService.state( orderNumber, type);
		return map;
	}
    
//全部评价   
@RequestMapping(value="evaluation")
public  @ResponseBody Map<String, Object> evaluation( String servicePersonal) throws ParseException {
	Map<String, Object> map = auntService.evaluation( servicePersonal);
	return map;
}
//一条评价   
@RequestMapping(value="oneEvaluation")
public  @ResponseBody Map<String, Object> oneEvaluation(  String orderNumber,String type) {
	Map<String, Object> map = auntService.oneEvaluation(  orderNumber, type);
	return map;
}
	//账户余额
	@RequestMapping(value="account")
	public  @ResponseBody Map<String, Object> account( String servicePersonal) throws ParseException {
		Map<String, Object> map = auntService.account( servicePersonal);
		return map;
	}
//消息通知
	@RequestMapping(value="notified")
	public  @ResponseBody Map<String, Object> notified(String servicePersonal,String type ) throws ParseException {
		Map<String, Object> map = auntService.notified(servicePersonal,type );
		return map;
	}
	@RequestMapping(value="clickNotified")
	public  @ResponseBody Map<String, Object> clickNotified(String id ) {
		Map<String, Object> map = auntService.clickNotified(id );
		return map;
	}
	//阿姨提现明细
		@RequestMapping(value="withdrawDetail")
		public  @ResponseBody Map<String, Object> withdrawDetail(String servicePersonal ) throws ParseException {
			Map<String, Object> map = auntService.withdrawDetail(servicePersonal );
			return map;
		}
		//提现提交
		@RequestMapping(value="withdraw")
		public  @ResponseBody Map<String, Object> withdraw(String servicePersonal,String type,String count,String number ,String check) throws ParseException {
			Map<String, Object> map = auntService.withdraw(servicePersonal, type,count, number , check );
			return map;
		}
		
		//进入提现
		@RequestMapping(value="enterWithdraw")
		public  @ResponseBody Map<String, Object> enterWithdraw(String servicePersonal,String type) {
			Map<String, Object> map = auntService.enterWithdraw(servicePersonal, type);
			return map;
		}
		@RequestMapping("feedBack")
		public  @ResponseBody Map<String,Object> addFeedBack(String phoneNumber,String text) {
			Map<String,Object> map=auntService.addFeedBack(phoneNumber,text);
			return map;
		}
	
  
	
}
